package com.bridge.bridge_wd.activity;

import android.content.Intent;
import android.view.View;

import com.bridge.bridge_wd.R;
import com.bridge.bridge_wd.adapter.QianBaoAdapter;
import com.bridge.bridge_wd.databinding.ActivityQianbaoBinding;
import com.bridge.common.base.BaseActivity;
import com.bridge.common.utils.UltimateBarXUtils;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;

/**
 * @ClassName QianBaoActivity
 * @Description TODO消息
 * @Author xushufeng
 * @CreateDate 2021/4/11 0011 19:43
 * @Version 1.0
 * @UpdateDate 2021/4/11 0011 19:43
 * @UpdateRemark 更新说明
 */
public class QianBaoActivity extends BaseActivity {
    QianBaoAdapter qianBaoAdapter;
    ActivityQianbaoBinding binding;
    List<String> datas = new ArrayList<>();

    @Override
    protected int layoutId() {
        return R.layout.activity_qianbao;
    }

    @Override
    protected void initView() {

        for (int i = 0; i < 10; i++) {
            datas.add("");
        }
        binding = getBind();
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        qianBaoAdapter = new QianBaoAdapter(this, datas);
        binding.recycleMingxi.setLayoutManager(manager);
        binding.recycleMingxi.setAdapter(qianBaoAdapter);
        binding.tvTixian.setOnClickListener(this);
        binding.tvChongzhi.setOnClickListener(this);
        binding.titleView.setRightText("...");
        binding.titleView.setRightTextVisible(true);
        binding.titleView.setRightTextColor(getResources().getColor(R.color.color_171515));
        binding.titleView.setRightTextViewOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                     turnToActivity(QianBaoMoreActivty.class);
            }
        });
        UltimateBarXUtils.setAppBar(this, true, true, R.color.white);
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        if (view.getId() == R.id.tv_tixian) {

            Intent  intent=new Intent(this,TiXianOrChongZhiActivity.class);
            intent.putExtra("type","1");
            startActivity(intent);
        }
        if (view.getId() == R.id.tv_chongzhi) {
            Intent  intent=new Intent(this,TiXianOrChongZhiActivity.class);
            intent.putExtra("type","2");
            startActivity(intent);
        }
    }

    @Override
    protected void setListenner() {

    }
}
